package cn.com.nes.site.controller.contract.vo;

import cn.com.nes.site.entity.em.contract.ContractAuditStatusEnum;
import cn.com.nes.site.entity.em.contract.ContractTypeEnum;
import cn.com.nes.site.entity.vo.PageVO;
import cn.com.nes.site.service.contract.bo.ContractBO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

@Data
@ApiModel(value = "合同分页列表入参模型")
public class ContractPageVO extends PageVO {

    @ApiModelProperty("合同UUID")
    private String contractUuid;

    @ApiModelProperty("合同名称")
    private String contractName;

    @ApiModelProperty("合同编号")
    private String contractNumber;

    @ApiModelProperty("合同类型")
    private String contractType;

    @ApiModelProperty("合同状态")
    private String contractStatus;

    @ApiModelProperty("合同审核状态")
    private String contractAuditStatus;

    @ApiModelProperty("客户UUID")
    private String customerUuid;

    @ApiModelProperty("客户名称")
    private String customerName;

    @ApiModelProperty("商机UUID")
    private String opportunityUuid;

    public ContractBO convertToBo() {
        ContractBO bo = new ContractBO();
        BeanUtils.copyProperties(this, bo);
        bo.setContractBelongCompanyId(this.getOperateUserCompanyId());
        bo.setContractType(ContractTypeEnum.getEnum(this.getContractType()));
        bo.setContractAuditStatus(ContractAuditStatusEnum.getEnum(this.getContractAuditStatus()));
        return bo;
    }

}
